<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\HomeConfig;

class CreateHomeConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('home_configs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('type')->default(HomeConfig::TYPE_IMAGE)->comment('类型');
            $table->string('mp4_or_image')->comment('视频或图片');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `home_configs` comment'首页配置'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('home_configs');
    }
}
